package com.example.spring.demo.service;

import io.minio.ObjectWriteResponse;
import io.minio.messages.Item;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.List;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2024/12/30 8:45
 **/
@Service
public interface MinioService {
    void ensureBucketExists() throws Exception;
    ObjectWriteResponse uploadFile(String objectName, MultipartFile file) throws Exception;
    InputStream downloadFile(String objectName) throws Exception;
    List<Item> listObjects();
    String getObjectUrl(String objectName);
    String getObjectUrl(String objectName, int time);
}
